package com.xunqi.content.feignclient;

import com.xunqi.common.dto.user.UserAddBonseDTO;
import com.xunqi.common.dto.user.UserDTO;
import com.xunqi.common.entity.user.User;
import com.xunqi.content.feignclient.fallbackFactory.UserCenterFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Description:
 * @Created with IntelliJ IDEA.
 * @author: 夏沫止水
 * @create: 2020-04-17 10:48
 **/
@FeignClient(name = "user-center",
        fallbackFactory = UserCenterFeignClientFallbackFactory.class
        //fallback = UserCenterFeignClientFallback.class
        )
public interface UserCenterFeignClient {

    @GetMapping(value = "/users/{id}")
    UserDTO findById(@PathVariable("id") Integer id);

    @RequestMapping(value = "/add-bonus")
    public User addBonus(@RequestBody UserAddBonseDTO userAddBonseDTO);
}
